#ifndef DependencyEncoder2O_H
#define DependencyEncoder2O_H
#include "DependencyEncoder2OGrandChild.h"
#include "DependencyPipe2O.h"

class DependencyEncoder2O : public DependencyEncoder2OGrandChild{
public:
	DependencyEncoder2O(int maxLength, DependencyPipe *pipe, char *trainforest, Parameters *param);
	virtual ~DependencyEncoder2O();
	virtual double gradient(long double *expected, int length);

protected:
	vector<vector<vector<double> > > probs_trips;
	vector<vector<vector<double> > > probs_sibs;

	virtual int getKey(int g, int s, int t, int dir, int comp, int length);
	virtual double getZ(int length, double *beta);
	virtual void inside_outside(int length, double *beta, double *alpha);
	virtual void getExpected(long double *expected, double *beta, double *alpha, double z, int length);
};
#endif
